package com.weishenai.Filter; /**
 * @Auther: weishenai
 * @Date: 2021/10/06/11:45
 * @Description:
 */

import javax.servlet.*;
import java.io.IOException;

public class loginFilter implements Filter {
    public void init(FilterConfig config) throws ServletException {
        System.out.println("loginFilter init");
    }

    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        System.out.println("loginFilter exec");

        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        chain.doFilter(request, response);
    }
}
